icontheme: Don't crash on icon lookup failure
authorBenjamin Otte <otte@redhat.com>
Thu, 5 Mar 2020 05:57:44 +0000 (06:57 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 5 Mar 2020 06:59:05 +0000 (07:59 +0100)
gtk/gtkicontheme.c

index b65caad8e748c023b70963dc54dc4500fc4ce569..569e500f1388025068fa4c3663b298715db4eaa9 100644 (file)
@@ -2209,11 +2209,12 @@ real_choose_icon (GtkIconTheme      *self,
               g_clear_object (&icon);
             }
 
-          icon->is_svg = suffix_from_name (icon->filename) == ICON_CACHE_FLAG_SVG_SUFFIX;
-          icon->is_resource = unthemed_icon->is_resource;
-
           if (icon)
-            goto out;
+            {
+              icon->is_svg = suffix_from_name (icon->filename) == ICON_CACHE_FLAG_SVG_SUFFIX;
+              icon->is_resource = unthemed_icon->is_resource;
+              goto out;
+            }
         }
     }